void interp_one_l(double *uf, double *uc, int nf)
//nf is the fine-grid dimension. The coarsegrid solution is input as uc[1..nc], where nc =(nf+1) /2. The fine-grid solution is returned in uf[1..nf]
{
  //odd-number 
  int ic,jc,nc,iic,iif;
    nc=(nf+1)/2.0;
  for (ic=1,jc=1;ic<=nc;ic++,jc+=2)
    uf[jc]=uc[ic];
  //even-number
  for (ic=1,jc=2;ic<nc;ic++,jc+=2)
    uf[jc]=0.5*uc[ic]+0.5*uc[ic+1];
}

